{template '_header'}

<link href="../addons/mx_shop/plugin/newstore/static/css/diypage.css?v=20170620" rel="stylesheet" type="text/css"/>
<link href="../addons/mx_shop/plugin/newstore/static/css/diypage.items.css?v=20170620" rel="stylesheet" type="text/css"/>
<link href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
<style>
    .diy-menu {
        width: 840px;
        height: auto;
        background: #fdfdfd;
        margin-right: -456px;
        border: 1px solid #ddd;
        border-radius: 3px;
        position: fixed;
        bottom: 0;
        right: 50%;
        box-shadow: 0 0 8px rgba(0,0,0,0.1);
        z-index: 999;
    }
    .diy-menu .action nav {
        margin-right: 5px;
    }

    .wb-container.right-panel .diy-menu {
        margin-right: -540px;
    }

    .wb-nav.fold~.wb-subnav~.wb-container .diy-menu {
        margin-right: -420px;
    }
    .wb-nav.fold~.wb-subnav~.wb-container.right-panel .diy-menu {
        margin-right: -505px;
    }

    .wb-nav~.wb-subnav.fold~.wb-container .diy-menu {
        margin-right: -400px;
    }

    .wb-nav~.wb-subnav.fold~.wb-container.right-panel .diy-menu {
        margin-right: -485px;
    }


    .wb-nav.fold~.wb-subnav.fold~.wb-container .diy-menu {
        margin-right: -365px;
    }
    .wb-nav.fold~.wb-subnav.fold~.wb-container.right-panel .diy-menu {
        margin-right: -450px;
    }
</style>

<div class="page-header">
    当前位置：<span class="text-primary">{if empty($item)}添加{else}编辑{/if}模板 {if !empty($item)}<small>(模板名称: {$item['name']})</small>{/if}</span>
</div>

<div class="page-content">
    <div class="row w840">
    <div class="diy-phone" data-store="{php echo intval($_W['merchid'])}">
        <div class="phone-head"></div>
        <div class="phone-body">
            <div class="phone-title" id="page">loading...</div>
            <div class="phone-main" id="phone">
                <p style="text-align: center; line-height: 400px;">您还没有添加任何元素</p>
            </div>
        </div>
        <div class="phone-foot"></div>
    </div>

    <div class="diy-editor form-horizontal" id="diy-editor">
        <div class="editor-arrow"></div>
        <div class="inner"></div>
    </div>


    <div class="diy-menu">
        <div class="navs" id="navs" style="display: block;">
            <nav class="btn btn-link" data-id="page"><i class="fa fa-cog"></i> 页面设置</nav>
        </div>
        <div class="action">
            <nav class="btn btn-default btn-sm" style="float: left; display: none" id="gotop"><i class="icon icon-top" style="font-size: 12px"></i> 返回顶部</nav>
            <nav class="btn btn-primary btn-sm btn-save" data-type="save">保存编辑</nav>
            <nav class="btn btn-success btn-sm btn-save" data-type="preview">保存并预览</nav>
        </div>
    </div>

    {template 'newstore/manage/diypage/_template_edit'}
    {template 'newstore/manage/diypage/_template_show'}
        </div>
</div>
<script type="text/javascript" src="./resource/components/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="./resource/components/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="./resource/components/ueditor/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript">
    var paths = ['../../plugin/newstore/static/js/diypage/diy.min', 'tpl', 'web/biz'];
    myrequire(paths, function(modal,tpl){
        window.tpl = tpl;
        modal.init({$initJson});
    });
</script>


{template '_footer'}